﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace CommonUtility
{
    public static class ConstWords
    {
        //常量

        //广播IP
        public const string IPMSG_BroadcastIP = "224.0.0.1";

        //UDP最大消息包
        public const int IPMSG_UDPMaxMessage = 2048;

        //IPMSG的版本号
        public const byte IPMSG_VERSION = 0x0001;

        //默认端口(2425)
        public const int IPMSG_DEFAULT_PORT = 0x0979;

        //消息分隔符
        public const string IPMSG_SEPARATOR = ":";

        //消息结尾
        public const char IPMSG_ENDOFMSG = '\0';

        /// <summary>
        /// 基本命令字
        /// </summary>
        public static class CommonCommand
        {
            //不进行任何操作
            public const uint IPMSG_NOOPERATION = 0x00000000;

            //用户上线
            public const uint IPMSG_BR_ENTRY = 0x00000001;

            //用户退出
            public const uint IPMSG_BR_EXIT = 0x00000002;

            //通报在线
            public const uint IPMSG_ANSENTRY = 0x00000003;

            //发送消息
            public const uint IPMSG_SENDMSG = 0x00000020;

            //通报收到消息
            public const uint IPMSG_RECVMSG = 0x00000021;

            //通报阅读消息
            public const uint IPMSG_READMSG = 0x00000030;

            //请求通过TCP传输文件
            public const uint IPMSG_GETFILEDATA = 0x00000060;

            //停止接收文件
            public const uint IPMSG_RELEASEFILES = 0x00000061;

            //请求传输文件夹
            public const uint IPMSG_GETDIRFILES = 0x00000062;
        }

        /// <summary>
        /// option for all command
        /// </summary>
        public static class OptionForAllCommond
        {
            //传送文件选项
            public const uint IPMSG_FILEATTACHOPT = 0x00200000;
        }

        /// <summary>
        /// option for send commond
        /// </summary>
        public static class OptionForSendCommond
        {
            //传送检查(需要对方返回确认信息)
            public const uint IPMSG_SENDCHECKOPT = 0x00000100;

            //封装
            public const uint IPMSG_SECRETOPT = 0x00000200;
        }

        /// <summary>
        /// file types for fileattach command
        /// </summary>
        public static class FileTypes
        {
            //普通文件
            public const uint IPMSG_FILE_REGULAR = 0x00000001;

            //目录文件
            public const uint IPMSG_FILE_DIR = 0x00000002;

            //返回上一级目录
            public const uint IPMSG_FILE_RETPARENT = 0x00000003;
        }
    }
}
